<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线五子棋</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div id="app">
        <h1>在线五子棋</h1>

        <!-- 用户输入昵称和房间号 -->
        <div id="userInputContainer">
            <label for="username">昵称:</label>
            <input type="text" id="username" placeholder="请输入昵称">
            
            <label for="gameId">房间号:</label>
            <input type="text" id="gameId" placeholder="请输入房间号">
            
            <button id="connectButton">连接游戏</button>
        </div>

        <!-- 游戏界面 -->
        <div id="gameContainer" style="display: none;">
            <!-- 显示房间号和用户昵称 -->
            <div id="gameInfo">
                <p>房间号: <span id="displayGameId"></span></p>
                <p>玩家昵称: <span id="displayUsername"></span></p>
            </div>

            <!-- 棋色选择器：连接后才显示 -->
            <div id="colorChoiceContainer" style="display: none;">
                <label>选择棋色:</label>
                <button id="blackColorButton" style="background-color: black; color: white;">黑色</button>
                <button id="whiteColorButton" style="background-color: white; color: black;">白色</button>
            </div>

            <canvas id="gomokuBoard" width="600" height="600"></canvas>
            <div id="status">等待选择棋色...</div>
            <button id="resetButton">重新开始</button>
            <button id="leaveRoomButton">退出房间</button>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>
